package cn.mxz.generator.config;

public class ReturnImpl implements IReturn {
	private String keyWord;
	
	private String returnDoc;

	@Override
	public String getReturnDoc() {
		return returnDoc;
	}
	
	@Override
	public void setReturnDoc(String returnDoc) {
		this.returnDoc = returnDoc;
	}
	
	@Override
	public void setKeyWord(String string) {
		if(string.equals("boolean")) {
			string = "Boolean";
		}
		this.keyWord = string;
	}

	@Override
	public String getType() {
		return keyWord;
	}
	
	@Override
	public String getTypeSimple() {
		int last = keyWord.lastIndexOf(".");
		if(last == -1) {
			return keyWord;
		}
		String ts = keyWord.substring(last + 1, keyWord.length());
		return ts;
	}

	@Override
	public boolean isVoid() {
		return keyWord.equals("void");
	}

	@Override
	public boolean isBaseType() {
		return BaseTypeConfig.contains(keyWord);
	}
}
